package com.yubest.demo.controller;

import com.yubest.demo.dto.OrderReqDTO;
import com.yubest.demo.service.OrderStrategy;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author hweiyu
 * @Description
 * @Date 2021/3/1 14:01
 */
@RestController
public class DemoController {

    @PostMapping(value = "/createOrder")
    public Object createOrder(@RequestBody OrderReqDTO reqDTO) {
        OrderStrategy.choose(reqDTO.getOrderType()).createOrder(reqDTO);
        return "{}";
    }

}
